/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package DTO;
import java.sql.Timestamp;


public class CHoaDon extends CTao{    
    private String sohoadon;
    private String loaiPhieu;//PN .Phieu nhap. PX. phieu xuat, hdbh . Hoa don ban hang. // hdmh Hoa don mua hang
    // PCK . Phieu chuyen kho
    private long nguoilapId;// nhan vien nhap hang
    private long nguoiGiaoId;//nhan vien giao hang
    private Timestamp ngayLap;    
    private long khachHangId;// Ma khach hang hay ma nhan cung cap
    private String ten;//Khach hang le va khach hang than quen
    private String diaChi;//
    private long khoId;    
    private Double tongtien;
    private Double chiet_khau;
    private int thang;
    public void setThang(int mm){
        this.thang = mm;
    }
    
    public int getThang(){
        return this.thang;
    }    
    
    private int nam;
    public void setNam(int nam){
        this.nam = nam;
    }
    
    public int getNam(){
        return this.nam;
    }
    
    public void setChietKhau(Double chiet_khau){
        this.chiet_khau = chiet_khau;
    }
    
    public Double getChietKhau(){
        return this.chiet_khau;
    }
    
    private int tinhTrang;
    public void setTinhTrang(int tinhTrang){
        this.tinhTrang = tinhTrang;
    }
    public int getTinhTrang(){
        return this.tinhTrang;
    }
    
    public void setTongTien(Double tongtien){
        this.tongtien = tongtien;
    }
    
    public Double getTongTien(){
        return this.tongtien;
    }
    
    public void setKhoId(long khoid){
        this.khoId = khoid;
    }
    public long getKhoId(){
        return this.khoId;
    }
    
    public CHoaDon(){
        this.chiet_khau = 0.0;
        this.tongtien = 0.0;
        this.nguoilapId = 0;
    }
    
    private Timestamp ngayNhap;
    public void setNgayNhap(Timestamp ngaynhap){
        this.ngayNhap = ngaynhap;
    }
    
    public Timestamp getNgayNhap(){
        return this.ngayNhap;
    }
    
    public void setKhachHangId(long khachhangId){
        this.khachHangId = khachhangId;
    }
    
    public long getKhachHangId(){
        return this.khachHangId;
    }
    public void setNguoiLapId(long id){
        this.nguoilapId = id;
    }
    public long getNguoilapId(){
        return this.nguoilapId;
    }
    public void setNguoiGiaoId(long id){
        this.nguoiGiaoId = id;
    }
    public long getNguoiGiaoId(){
        return this.nguoiGiaoId;
    }
    
    public void setLoaiPhieu(String loaiPhieu){
        this.loaiPhieu = loaiPhieu;
    }
    
    public String getLoaiPhieu(){
        return this.loaiPhieu;
    }
    
    public void setSoHoaDon(String hoadon){
        this.sohoadon = hoadon;
    }
    
    public String getHoaDon(){
        return this.sohoadon;
    }
    public String toString(){
        StringBuilder sBuilder = new StringBuilder();
        sBuilder.append("{");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.id,this.getId() ));
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.chiet_khau,this.getChietKhau()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.khach_hang_id,this.getKhachHangId()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.kho_id,this.getKhoId()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.loai_phieu,this.getLoaiPhieu()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.nam,this.getNam()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.ngay_nhap,this.getNgayNhap()));        
        sBuilder.append(",");
        sBuilder.append(String.format("\"%s\" :\" %s \"",CFields.ngay_sua,this.getNgaySua()));        
        sBuilder.append("}");
        return sBuilder.toString();
    }
}
